package com.css.apps.task.obj;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.css.apps.task.model.TTask;
import com.css.db.query.QueryCache;
import com.css.util.StringHelper;

public class TTaskItem {
	
	private static Log log = LogFactory.getLog(TTaskItem.class);
	public static String gTaskItem = "gTaskItem";

	public TTask getTaskFromDB(String uuid) {
		if (StringHelper.isEmpty(uuid))
			return null;
		try {
			return QueryCache.get(TTask.class, uuid);
		} catch (Exception ex) {
			log.error(ex.getMessage());
			return null;
		}
	}

	public static TTask getTask(String uuid) {
		if (StringHelper.isEmpty(uuid))
			return null;
		try {
			return QueryCache.get(TTask.class, uuid);
		} catch (Exception ex) {
			log.error(ex.getMessage());
			return null;
		}
	}

	@SuppressWarnings("unchecked")
	public static List<TTask> getTaskList(List<String> idList) {
		return QueryCache.idToObj(TTask.class, idList);
	}

}
